// pages/new_inter/hotel_dcils/hotel_dcils.js
import WxParse from '../../../wxParse/wxParse.js';
const app = getApp();

Page({

  /**
   * 页面的初始数据
   */
  data: {
    new_loupan: [
      {
        Image: '../../images/6.jpg',
        HousePrice: '￥159万',
        Title: '公寓名称',
        Prov: '省',
        City: '市',
        County: '区',
      },
      {
        Image: '../../images/6.jpg',
        HousePrice: '￥159万',
        Title: '公寓名称',
        Prov: '省',
        City: '市',
        County: '区',
      },
      {
        Image: '../../images/6.jpg',
        HousePrice: '￥159万',
        Title: '公寓名称',
        Prov: '省',
        City: '市',
        County: '区',
      },
      {
        Image: '../../images/6.jpg',
        HousePrice: '￥159万',
        Title: '公寓名称',
        Prov: '省',
        City: '市',
        County: '区',
      },
    ],
    indicatorDots: true,
    vertical: false,
    autoplay: true,
    interval: 3000,
    duration: 800,
    num: 3,
    hostUrl: app.globalData.hostUrl,


  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.house_city(options.quid)
  },
  house_city: function (quid) { //读取首页banner
    var that = this;
    wx.request({
      url: app.globalData.apiUrl + 'House/city',
      data: {
        // opt: 'getBanner',
        qu_code: quid,
      },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res)
        if (res.data != null) {
          WxParse.wxParse('Content', 'html', res.data['city'].hotel_intro, that, 5),

            // var adv = res.data.adv[1];
            // for (var i = 0, len = adv.length; i < len; ++i) {
            //   var desc = that.delHtmlTag(res.data.adv[1][i].desc)
            //   res.data.adv[1][i].desc = desc;
            // }
            that.setData({
              info: res.data,
            })

          console.log(that.data.info, '过滤后')
        }
      }
    })
    // console.log(that.data.imgBanner['0'])

  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  //onShareAppMessage: function () {

  //},
  index: function () {
    wx.reLaunch({
      url: '/pages/index/index'
    })
  },
})